<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Trello board</title>
</head>
<body>
	<script type="text/javascript">
		setInterval('window.location.reload()', 30000);
	</script>
	<h2>Trello board</h2>
	<h4>${time}</h4>
	<table>
		<tr>
			<td style="width:100px;">Board Name:</td>
			<td>${trello.boardName}</td>
		</tr>
		<tr>
			<td>Description:</td>
			<td>${trello.boardDescription}</td>
		</tr>
		<tr>
			<td>URL:</td>
			<td>${trello.boardUrl}</td>
		</tr>						
	</table>
	
	<h4>Members</h4>
	<table border="1">
		<tr>
			<th style="width: 150px;" align="center">id</th>
			<th style="width: 100px;" align="left">Full Name</th>
			<th style="width: 100px;" align="left">Username</th>
			<th style="width: 100px;" align="left">Member Type</th>
			<th style="width: 60px;" align="left">Status</th>
		</tr>
		<c:forEach var="s" items="${trello.members}">
			<tr>
				<td align="center">${s.id}</td>
				<td align="left">${s.fullname}</td>
				<td align="left">${s.username}</td>
				<td align="left">${s.memberType}</td>
				<td align="left">${s.status}</td>
			</tr>
		</c:forEach>
	</table>
	
	<h4>Lists</h4>
	<table border="1">
		<tr>
			<th style="width: 100px;" align="left">Name</th>
			<th style="width: 500px;" align="left">Cards</th>
		</tr>
		<c:forEach var="list" items="${trello.lists}">
			<tr>
				<td align="left">${list.name}</td>
				<td>				
					<table>
						<tr>
							<th style="width: 200px;" align="left">Name</th>
							<th style="width: 150px;" align="left">Description</th>
							<th style="width: 150px;" align="left">Members</th>
						</tr>
						<c:forEach var="card" items="${list.cards}">
							<tr>
								<td align="left">${card.name}</td>
								<td align="left">${card.description}</td>
								<td align="left">${card.participants}</td>							
							</tr>
						</c:forEach>
					</table>
				</td>
			</tr>
		</c:forEach>
	</table>
	
	<h4>Actions (Three latest actions)</h4>
	<table border="1">
		<tr>
			<th style="width: 100px;" align="left">Creator Name</th>
			<th style="width: 200px;" align="left">Data</th>
			<th style="width: 100px;" align="left">Type</th>
			<th style="width: 110px;" align="left">Date</th>
		</tr>
		<c:forEach var="action" items="${trello.actions}">
			<tr>
				<td align="left">${action.memberCreatorName}</td>
				<td align="left">${action.data}</td>
				<td align="left">${action.type}</td>
				<td align="left">${action.date}</td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>